﻿/*
 * User: Masy Freddy
 * Date: 9/09/2011
 * Time: 20:44
 */

namespace MetaVideoEditorEvolved.AddIn.AddInAdapters
{
	using System;
	using System.AddIn.Pipeline;
	using System.Collections.Generic;

	using MetaVideoEditorEvolved.AddIn.AddInViews;
	using MetaVideoEditorEvolved.AddIn.Contracts;
	using MetaVideoEditorEvolved.AddIn.Entity;

	[AddInAdapter]
	public class ProviderAdapter : ContractBase, IProviderContract
	{
		private ProviderView view;
		
		public ProviderAdapter(ProviderView view)
		{
			this.view = view;
		}
		
		public List<ProviderSearchResult> FindPossible(ProviderSearchRequest request)
		{
			return this.view.FindPossible(request);
		}
		
		public void ShowOption()
		{
			AppDispatcher.Current.DoWork(delegate()
			                             {
			                             	this.view.ShowOption();
			                             });
		}
		
		public Movie FetchMovie(int movieId)
		{
			return this.view.FetchMovie(movieId);
		}
		
		public Serie FetchSerie(string serieId)
		{
			return this.view.FetchSerie(serieId);
		}
		
		public Season FetchSeason(string serieId, int seasonNumber)
		{
			return this.view.FetchSeason(serieId, seasonNumber);
		}
		
		public Episode FetchEpisode(string serieId, int seasonNumber, int episodeNumber)
		{
			return this.view.FetchEpisode(serieId, seasonNumber, episodeNumber);
		}
		
		public bool HasOption()
		{
			return this.view.HasOption();
		}
	}
}
